<template>
  <div>
        <el-table :data="rfiItemData" border style="width: 100%" max-height="250">
            <el-table-column prop="dataName" align="left" label="资料名称"  width="180"></el-table-column>
            <el-table-column prop="actionScope" align="left" label="作用域" :formatter="getScope" width="180"></el-table-column>
            <el-table-column prop="indateFlag" align="left" label="有效期" :formatter="getIndate" width="180"></el-table-column>
            <el-table-column prop="aptitudeFlag" align="left" label="资质" :formatter="getAptitude" width="180"></el-table-column>
        </el-table>
  </div>
</template>
<script>
  export default {
    data() {
      return {
        // 初始化表格数据
        rfiItemData: []
      };
    },
    mounted() {
      this.query();
    },
    methods: {
      query(){
        this.axios.post(this.lib.config.host.vendorMgt + "/vendormgt/vsp/rfi/queryRfiItems/" + this.$route.query.rfiId)
        .then((response)=> {
            this.rfiItemData = response.data;
        })
        .catch((error)=> {
            console.log(error);
        });
      },
      getScope(value) {
        if(value.actionScope == 1){
            return '公司';
        }
        if(value.actionScope == 2){
            return '材料';
        }
        if(value.actionScope == 3){
            return '其它';
        }
      },
      getIndate(value) {
        if(value.indateFlag == 1){
            return '永久';
        }
        if(value.indateFlag == 2){
            return '过期失效';
        }
        if(value.indateFlag == 3){
            return '一次性';
        }
      },
      getAptitude(value) {
        if(value.aptitudeFlag == 0){
            return '否';
        }
        if(value.aptitudeFlag == 1){
            return '是';
        }
      }
    }
  }
</script>